home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr45
/
convt2sn.zip
/
CONV2SND.DOC
< prev
next >
Wrap
Text File
|
1993-02-03
|
11KB
|
292 lines
(******CONV2SND.DOC******)
* *
* Revision 1.09 (DOC) *
* *
* CONV2SND.PAS: 1.98 *
* *
* February 3, 1993 *
* *
* Kenneth Udut *
* *
(******CONV2SND.DOC******)
CONV2SND.EXE, CONV2SND.PAS, CONV2SND.DOC, CONV2SND.HST HEREBY ARE
RELEASED INTO THE PUBLIC DOMAIN. UNLESS SPECIAL CIRCUMSTANCES WARRENT
OTHERWISE, EVERY SOFTWARE PRODUCT CREATED BY (_KENNETH UDUT_) WILL:
1. BE RELEASED INTO THE PUBLIC DOMAIN, FREELY COPYABLE AND CHANGEABLE.
2. INCLUDE THE SOURCE CODE.
AS THE AUTHOR OF (_CONV2SND_), I WOULDN'T MIND CREDIT FOR MY WORK.
HOWEVER, IT IS *NOT* A NECESSITY, SO DON'T WORRY ABOUT IT! :)
now enough of this screaming!
1. CONV2SND is a program with one thing in mind: To open the worlds
of digitized sounds created on other machines and by other methods
to anyone using a Tandy 1000 SL, TL, RL, RLX, 2500 RLX, RSX and
every other machine that uses:
SOUND.PDM
I wish that Tandy had created something a few years ago that would
have done this, as it might have kept the Tandy's with the
surpurb 8-bit DAC a little more in step with the SoundBlaster,
the Macintosh, the Amiga and the Atari ST, all of which are able
to create surpurb digitized sounds and have programs that allow
you to share them with one another.
So, here it is.
2. Usage: CONV2SND filename. The process will then take place
automatically.
It does not check for disk space, yet. For now, simply make sure
that there is enough space on the disk for ANOTHER copy of the
file you are converting plus 44 bytes.
You will be asked a couple of questions.
A) Asks about the sampling rate. ("Speed of playback")
5500 is a slow sampling rate, often used for speech purposes or some
games.
11000 is the the most common sampling rate. It is #2 on the selection
list and the one you will want to try first. The only reason it
is so popular is that it is of sufficient quality for music and
such. 5500 really isn't. WAV files are usually sampled at 11000
samples per second.
22000 is most often used with the Macintosh Sound files. It is of
a higher quality, but it does take up more disk space, which is
why it is the 2nd most popular sampling rate to record at.
If you screw up and select the wrong one, that's okay! Just redo the
procedure and select a different rate next time!
B) Asks for the "name" of the sound.
This isn't the file name. This is the name that appears when you
are in SOUND.PDM, right next to "Name: ", in the right hand box.
The only reason I "require" that you answer it at the moment is that
it's important to have a 'hard coded' name for the sound, just in case
the file name gets changed.
You can read the name of the sound by typing DEBUG filename.snd and
then "d". You will see the name of the sound file in the right hand
size of the screen. (NOTE: "q' gets you out of DEBUG)
C) Asks for your name. No real reason yet, but I'm thinking of one!
A file called DM_SOUND.SND will be created. This is the DeskMate
SOUND version of the other digitized file. As of version 1.77,
there isn't a way to change the sampling rate, but that will
be an option with the next release (coming shortly).
3. You will need to do the following after the file is created:
* Go into SOUND.PDM, and load the file (F2, Open)
* Open DM_SOUND.SND. That is your sound file in DeskMate SND form.
* You will see "Unexpected End-Of-File" error.
DON'T WORRY -- that is normal. I will explain in a minute.
* Play the file, and carefully remove the nasty noise, or dropout
at the end of the file, using very small increments (.001
seconds works for me).
* Hit F2 and do a Save As... Name the file something MEMORABLE,
preferably similar to the name of the file you just converted!
Example: ROCKY.WAV is converted into DM_SOUND.SND
After getting rid of the little end noise (and possibly
some beginning noise as well), hit F2, Save As... and name
the file ROCKY.
That's it! My phone (908) 241-6246 is open for your use up 'till
about 11pm or so. I'm kudut@hamp.hampshire.edu on the Internet, and
Kenneth Udut, 170 East Clay Avenue, Roselle Park, NJ USA 07204-2050.
P.S. -- The reason you get "Unexpected End-Of-File During Read" is that
the "sample size" (number of 'sound samples' in the file) is
hard coded into the header, as you shall see below.
Since I don't have the math precisely right, DeskMate SOUND will
read just a few more bytes than it needs to, causing the error.
And, in case you are wondering, you will *not* be destroying the
'next file' on the disk (which is what it is reading in), so you
can let your breath out now! :) {Ken, on Feb 3, 1993}
-----------[technical stuff]------------
digitized sound files are practically all identical in makeup.
atari, amiga, tandy, soundblaster, sun, all create the same basic
digitized sound files.
the difference lies in the 'header'.
the header of a file is a small series of bytes, 44 in the case of
DeskMate .SND files. The purpose of a header?
a header tells the program how big the file is, as most programs
that read digitized sound files need to be specially told how many
bits of sound it needs to load up. it also might tell you the 'name'
or description of the sound file. the sampling rate (how fast the
sound was recorded and should be played back) is also usually
included.
here is the makeup of deskmate SOUND.PDM digitized sound files:
[thanks to Christopher Taveres for this information]
======================================================================
/* Sound Off!
/* Written by Christopher Taveres
/* Copyright (c) January 1992
/* Falsoft, Inc.
/* PCM
/** Definintion for the header block for Deskmate .snd files **/
struct dmheader { /* Structure of the header block */
int marker; /* Marker bytes - should be 00 1a */
char note_count; /* Number of notes in instrument file */
char inst_num; /* Instrument number */
char inst_name[10]; /* Instrument name */
int sample_rate; /* Sampling rate */
char filler[16]; /* I don't know what this does */
unsigned long sample_size; /* Number of samples in file */
char filler2[8]; /* More unknown space */
======================================================================
There are 44 bytes in a deskmate sound file header.
Here is PIANO.SND's header decoded for you!
(If you type DEBUG PIANO.SND, then d you can see this for yourself!)
1A 01 03 02 50 69 61 6E-6F 00 00 00 00 00 F8 2A ....Piano......*
\___/ | | \___________________________/ \____/
| | | | |_____Sampling Rate
| | | |___Instrument/Sound Name
| | |
| | |_____Instrument Number
| |
| |________Number of Instruments in file
|
|_____________Marker blocks. Either 1A 01 or 00 1A it seems.
10 00 01 19 64 00 00 00-0A 22 00 00 00 00 00 00 ....d...."......
\_____________________________________________/
\
\__________Haven't a clue as to what it does, yet!
13 3B 00 00 00 00 00 00-00 00 00 00 1C 00 1A 27 .;.............'
\_________/ \______________________/\_________/
\ \___More unknown. \___start of piano sound.
\
\_____Number of samples in the file. VERY hard for me
to figure out. Check out source code. Wierd math
seems to be involved, and I don't fully understand what
I did!
I first attempted to recreate the structure that I saw in the
SOUNDOFF.C file (which is copyrighted by PCM, the Tandy magazine) in
Turbo Pascal 6.0, but I wasn't successful. Whatever it created was
NOT the header file it should have been!
So, I did it bit by bit. By golly - it worked! Realizing that I
could do this opened up a whole new world! In no short order, I might
just be able to get together a simple program that allows you to
switch headers back and forth from different digitized sound files!
From DeskMate to Windows .WAV!
If you feel you're up to the task, you're welcome to the challenge!
This may be the only bit of programming I do in this respect.
All I need to do now is to figure out how to precisely get the
digitized sound file size right so that there isn't that
"Unexpected End-of-file during read." error.
Thanks for reading and hope you NOT ONLY enjoy using it, but also
play around with the source code and work with it!
I want to see a world where source code is freely distributable, where
there isn't all that "data-hiding" and all that. I would hate to see
a society where the 'elite programmers' only knew the secrets of
'real' programming, while the pions were kept down low...
I prefer openness and honesty, personally :)
Talk to you soon!
--Ken
February 3, 1993
FIDONET: Kenneth Udut @ 1:107/900
INTERNET: kudut@hamp.hampshire.edu
America Online: K Udut
PC-Link: K Udut
CompuServe: INTERNET> kudut@hamp.hampshire.edu
BITNET: kudut%hamp.hampshire.edu@yalevm.bitnet
Home Address:
Kenneth Udut
170 East Clay Avenue
Roselle Park, New Jersey 07204-2050
Phone Numbers:
(908) 241-6246
(908) 241-8528 -- FAX number
Can be found on:
The Juice Bar BBS, located in Roselle Park, New Jersey, USA
(908) 298-0764. I'm user #11, and a VERY VERY active poster!
I also run a list on BITNET.
Y-RIGHTS@SJUVM.BITNET - discussion on the rights of kids and teens.
Leave me a message somewhere or give me a phone call!
I'll set a pot of tea out for you and we'll chat :)